//============================================================================
// Copyright (C) 2003-2013 Brett R. Jones 
// All Rights Reserved
//
// You may redistribute and/or modify for non commercial and commercial uses 
// provided this copyright notice remains in place and is not modified
//
// This code is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
//
// brettjones1900@gmail.com
// http://www.p2panarchy.com
//============================================================================
class PktGameAcctsReq : public VxPktHdr
{
public:
	PktGameAcctsReq()
	{
		memset( this, 0, sizeof( PktGameAcctsReq ) );
		m_u16PktLen = sizeof( PktGameAcctsReq );
		m_u16PktType = PKT_TYPE_GAME_ACCTS_REQ;
	}
	U16					u16ActiveAccts;								// number of valid active accounts		
	U32					au32Sn[PKT_MAX_AVATARS_PER_PLAYER];				// serial number of avatar
	TCHAR				atcNames[ PKT_MAX_AVATARS_PER_PLAYER ][ (PKT_MAX_AVATAR_NAME_LEN + 1) ];	// char name 
	void CalcLen( int iActiveAccts )
	{
		// calculate length of packet.. iPwdLen must include null terminator
		u16ActiveAccts = (U16)iActiveAccts;
		m_u16PktLen = (U16)ROUND_TO_16BYTE_BOUNDRY( ( sizeof( PktGameAcctsReq ) - sizeof( atcNames ) ) +  (iActiveAccts * (PKT_MAX_AVATAR_NAME_LEN + 1)) );
	}
};